<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/9/8
  Time: 15:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../common/include.jsp" %>
<html>
<head>
    <title>Title</title>

    <!-- css -->
    <script type="text/javascript" src="js/ajaxfileupload.js" charset="utf-8"></script>
    <style>
        .mar {
            margin-top: 8px;
        }

        .fileinput-button {
            position: relative;
            display: inline-block;
            overflow: hidden;
        }

        .fileinput-button input {
            position: absolute;
            right: 0px;
            top: 0px;
            opacity: 0;
            -ms-filter: 'alpha(opacity=0)';
            font-size: 200px;
        }
    </style>
    <script type="text/javascript">
        var serverIp = "localhost:8080";
        var editor1 = null;
        $(function () {
            $(".col-sm-4").addClass("mar");
            $(".col-sm-8").addClass("mar");
            $(".col-sm-10").addClass("mar");
        });


        //上传规格对应图片
        function ajaxUploads(obj, id, status, fileId) {
            $.ajaxFileUpload({
                //处理文件上传操作的服务器端地址(可以传参数,已亲测可用)
                url: "updateFiles.html",
                secureuri: false,
                data: {"id": id, "status": status},
                fileElementId: fileId,
                //是否启用安全提交,默认为false
                dataType: 'text',
                success: function (data, status) {
                    data = jQuery.parseJSON(data)

                    //服务器响应成功时的处理函数
                    if (data.error == 0) {
                        var filesStr = "<a target='_blank' href='" + data.url + "'>" + data.fileName + "</a><br>";

                        window.location.reload();

                    }
                    else {
                        layer.msg(data.message);
                    }
                },
                error: function (data, status, e) { //服务器响应失败时的处理函数
                    layer.msg(data.message);
                }
            })
        };
    </script>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">
    <form class="form-horizontal" id="demandForm" name="demandForm">
        <div class="tabs-container">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a data-toggle="tab" href="#tab-1" aria-expanded="true"> <i
                            class="fa fa-angle-double-right"></i> 进度</a>
                </li>
                <li class="">
                    <a data-toggle="tab" href="#tab-2" aria-expanded="false"> <i
                            class="fa fa-file-text-o"></i> 暂停记录</a>
                </li>
                <li class="">
                    <a data-toggle="tab" href="#tab-3" aria-expanded="false"> <i
                            class="fa fa-refresh"></i> 转移记录</a>
                </li>
                <li class="">
                    <a data-toggle="tab" href="#tab-4" aria-expanded="false"> <i
                            class="fa fa-undo"></i> 驳回申请记录</a>
                </li>
                <li class="">
                    <a data-toggle="tab" href="#tab-5" aria-expanded="false"> <i
                            class="fa fa-pencil-square-o"></i> 客户评价</a>
                </li>
                <li class="">
                    <a data-toggle="tab" href="#tab-6" aria-expanded="false"> <i
                            class="fa fa-exclamation-triangle"></i> 测试BUG</a>
                </li>
            </ul>
            <div class="tab-content" style="font-size: 13px">
                <div id="tab-1" class="tab-pane active">
                    <div class="panel-body">
                        <fieldset>

                            <div class="form-group">
                                <!-- 一条进度开始 -->

                                <div class="col-xs-1 loopitem loopitem_active">

                                    <div class="colorbox">
                                        <img src="h/img/process_active.png?2017" alt="">
                                    </div>
                                    <p class="textarea">
                                        待审核
                                    </p>
                                    <div class="dir_line"></div>
                                </div>


                                <!-- 一条进度结束 -->
                                <!-- 一条进度开始 -->
                                <c:if test="${resultMap.maxPro.status >= 2}">
                                    <div class="col-xs-1 loopitem loopitem_active">
                                        <div class="colorbox">
                                            <img src="h/img/process_active.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            待设计
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>
                                <c:if test="${null== resultMap.maxPro.status || resultMap.maxPro.status < 2  }">
                                    <div class="col-xs-1 loopitem loopitem">
                                        <div class="colorbox">
                                            <img src="h/img/process_grey.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            待设计
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>

                                <!-- 一条进度结束 -->
                                <!-- 一条进度开始 -->
                                <c:if test="${resultMap.maxPro.status >= 3}">
                                    <div class="col-xs-1 loopitem loopitem_active">
                                        <div class="colorbox">
                                            <img src="h/img/process_active.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            设计中
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>
                                <c:if test="${null== resultMap.maxPro.status || resultMap.maxPro.status < 3  }">
                                    <div class="col-xs-1 loopitem loopitem">
                                        <div class="colorbox">
                                            <img src="h/img/process_grey.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            设计中
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>

                                <!-- 一条进度结束 -->
                                <!-- 一条进度开始 -->
                                <c:if test="${resultMap.maxPro.status >= 4}">
                                    <div class="col-xs-1 loopitem loopitem_active">
                                        <div class="colorbox">
                                            <img src="h/img/process_active.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            设计完成
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>
                                <c:if test="${null== resultMap.maxPro.status || resultMap.maxPro.status < 4  }">
                                    <div class="col-xs-1 loopitem loopitem">
                                        <div class="colorbox">
                                            <img src="h/img/process_grey.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            设计完成
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>

                                <!-- 一条进度结束 -->
                                <!-- 一条进度开始 -->
                                <c:if test="${resultMap.maxPro.status >= 5}">
                                    <div class="col-xs-1 loopitem loopitem_active">
                                        <div class="colorbox">
                                            <img src="h/img/process_active.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            评审中
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>
                                <c:if test="${null== resultMap.maxPro.status || resultMap.maxPro.status < 5  }">
                                    <div class="col-xs-1 loopitem loopitem">
                                        <div class="colorbox">
                                            <img src="h/img/process_grey.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            评审中
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>

                                <!-- 一条进度结束 -->
                                <!-- 一条进度开始 -->
                                <c:if test="${resultMap.maxPro.status >= 6}">
                                    <div class="col-xs-1 loopitem loopitem_active">
                                        <div class="colorbox">
                                            <img src="h/img/process_active.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            分配中
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>
                                <c:if test="${null== resultMap.maxPro.status || resultMap.maxPro.status < 6  }">
                                    <div class="col-xs-1 loopitem loopitem">
                                        <div class="colorbox">
                                            <img src="h/img/process_grey.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            分配中
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>

                                <!-- 一条进度结束 -->
                                <!-- 一条进度开始 -->
                                <c:if test="${resultMap.maxPro.status >= 7}">
                                    <div class="col-xs-1 loopitem loopitem_active">
                                        <div class="colorbox">
                                            <img src="h/img/process_active.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            审批中
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>
                                <c:if test="${null== resultMap.maxPro.status || resultMap.maxPro.status < 7  }">
                                    <div class="col-xs-1 loopitem loopitem">
                                        <div class="colorbox">
                                            <img src="h/img/process_grey.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            审批中
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>

                                <!-- 一条进度结束 -->
                                <!-- 一条进度开始 -->
                                <c:if test="${resultMap.maxPro.is_majordomo != null || resultMap.maxPro.status >= 8}">
                                    <div class="col-xs-1 loopitem loopitem_active">
                                        <div class="colorbox">
                                            <img src="h/img/process_active.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            待开发
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>
                                <c:if test="${null== resultMap.maxPro.status || resultMap.maxPro.status < 8 && resultMap.maxPro.is_majordomo == null}">
                                    <div class="col-xs-1 loopitem loopitem">
                                        <div class="colorbox">
                                            <img src="h/img/process_grey.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            待开发
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>

                                <!-- 一条进度结束 -->
                                <!-- 一条进度开始 -->
                                <c:if test="${resultMap.maxPro.status >= 9}">
                                    <div class="col-xs-1 loopitem loopitem_active">
                                        <div class="colorbox">
                                            <img src="h/img/process_active.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            开发中
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>
                                <c:if test="${null== resultMap.maxPro.status || resultMap.maxPro.status < 9  }">
                                    <div class="col-xs-1 loopitem loopitem">
                                        <div class="colorbox">
                                            <img src="h/img/process_grey.png" alt="">
                                        </div>
                                        <p class="textarea">
                                            开发中
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>

                                <!-- 一条进度结束 -->
                                <!-- 一条进度开始 -->
                                <c:if test="${resultMap.maxPro.status >= 10}">
                                    <div class="col-xs-1 loopitem loopitem_active">
                                        <div class="colorbox">
                                            <img src="h/img/process_active.png"
                                                 alt="">
                                        </div>
                                        <p class="textarea">
                                            待测试
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>
                                <c:if test="${null== resultMap.maxPro.status || resultMap.maxPro.status < 10  }">
                                    <div class="col-xs-1 loopitem loopitem">
                                        <div class="colorbox">
                                            <img src="h/img/process_grey.png"
                                                 alt="">
                                        </div>
                                        <p class="textarea">
                                            待测试
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>

                                <!-- 一条进度结束 -->
                                <!-- 一条进度开始 -->
                                <c:if test="${resultMap.maxPro.status >=11 }">
                                    <div class="col-xs-1 loopitem loopitem_active">
                                        <div class="colorbox">
                                            <img src="h/img/process_active.png"
                                                 alt="">
                                        </div>
                                        <p class="textarea">
                                            测试中
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>
                                <c:if test="${null== resultMap.maxPro.status || resultMap.maxPro.status <11 }">
                                    <div class="col-xs-1 loopitem loopitem">
                                        <div class="colorbox">
                                            <img src="h/img/process_grey.png"
                                                 alt="">
                                        </div>
                                        <p class="textarea">
                                            测试中
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>

                                <!-- 一条进度结束 -->
                                <!-- 一条进度开始 -->
                                <c:if test="${resultMap.maxPro.status >= 12}">
                                    <div class="col-xs-1 loopitem loopitem_active">
                                        <div class="colorbox">
                                            <img src="h/img/process_active.png"
                                                 alt="">
                                        </div>
                                        <p class="textarea">
                                            已处理
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>
                                </c:if>
                                <c:if test="${null== resultMap.maxPro.status || resultMap.maxPro.status < 12  }">
                                    <div class="col-xs-1 loopitem loopitem">
                                        <div class="colorbox">
                                            <img src="h/img/process_grey.png"
                                                 alt="">
                                        </div>
                                        <p class="textarea">
                                            已处理
                                        </p>
                                        <div class="dir_line"></div>
                                    </div>

                                </c:if>

                                <!-- 一条进度结束 -->
                            </div>
                            <legend>基本信息</legend>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">标题：</label>
                                <div class="col-sm-8">
                                    ${resultMap.tDemandSource.title}
                                </div>

                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">问题产品：</label>
                                <div class="col-sm-4"
                                     style="margin-top: 8px">
                                    ${resultMap.tDemandSource.demandProductName}
                                </div>
                                <label class="col-sm-2 control-label">反馈来源：</label>
                                <div class="col-sm-4">
                                    ${resultMap.tDemandSource.feedbackSource}


                                </div>
                            </div>


                            <div class="form-group">
                                <label class="col-sm-2 control-label">反馈城市：</label>
                                <div class="col-sm-4">
                                    ${resultMap.tDemandSource.feedbackCity}

                                </div>
                                <label class="col-sm-2 control-label">反馈人：</label>
                                <div class="col-sm-4">
                                    ${resultMap.tDemandSource.feedbackName}
                                </div>

                            </div>

                            <div class="form-group">

                                <label class="col-sm-2 control-label">反馈时间：</label>
                                <div class="col-sm-4">
                                    <div class="input-group date">
                                        ${resultMap.tDemandSource.feedbackTime}

                                    </div>

                                </div>

                                <label class="col-sm-2 control-label">录入人：</label>
                                <div class="col-sm-4">
                                    ${resultMap.tDemandSource.createName}

                                </div>

                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">录入时间：</label>
                                <div class="col-sm-4">
                                    ${resultMap.tDemandSource.createTime}

                                </div>

                                <label class="col-sm-2 control-label">处理部门：</label>
                                <div class="col-sm-4">
                                    ${resultMap.tDemandSource.department}

                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">优先级：</label>
                                <div class="col-sm-4">
                                    <c:if test="${resultMap.tDemandSource.priority == 1}">一级</c:if>
                                    <c:if test="${resultMap.tDemandSource.priority == 2}">二级</c:if>
                                    <c:if test="${resultMap.tDemandSource.priority == 3}">三级</c:if>
                                    <c:if test="${resultMap.tDemandSource.priority == 4}">四级</c:if>
                                    <c:if test="${resultMap.tDemandSource.priority == 5}">五级</c:if>

                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">问题描述：</label>
                                <div class="col-sm-10">
                                    ${resultMap.tDemandSource.detail}

                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">附件：</label>
                                <div class="col-sm-5">
                                    <c:forEach
                                            items="${resultMap.files1}"
                                            var="files">
                                        <a target="_blank"
                                           href="${files.url}">${files.file_names}</a><br>
                                    </c:forEach>
                                </div>


                            </div>

                        </fieldset>
                        <!-- 循环遍历进度信息-->
                        <c:forEach items="${resultMap.proList}" var="pro" varStatus="index">
                            <c:if test="${index.index == 0}">
                                <fieldset>

                                    <legend>需求审核</legend>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">审核人：</label>
                                        <div class="col-sm-4">
                                                ${pro.operation_name}
                                        </div>

                                        <label class="col-sm-2 control-label">审核结果：</label>
                                        <div class="col-sm-4">
                                            <c:if test="${pro.is_receive == 1}">已通过</c:if>
                                            <c:if test="${pro.is_receive == 2}">已驳回</c:if>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">审核时间：</label>
                                        <div class="col-sm-4">
                                                ${pro.operation_time}
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">处理意见：</label>
                                        <div class="col-sm-10">
                                                ${pro.remark}
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">附件：</label>
                                        <div class="col-sm-10">
                                            <c:forEach items="${pro.filesList}" var="files">
                                                <a target="_blank" href="${files.url}">${files.file_names}</a><br>
                                            </c:forEach>
                                        </div>
                                    </div>


                                </fieldset>
                            </c:if>
                            <c:if test="${index.index == 1}">
                                <fieldset>

                                    <legend>产品设计</legend>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">产品经理：</label>
                                        <div class="col-sm-4">
                                                ${pro.operation_name}
                                        </div>


                                        <label class="col-sm-2 control-label">开始时间：</label>
                                        <div class="col-sm-4">
                                                ${pro.operation_time}
                                        </div>


                                    </div>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">设计状态：</label>
                                        <div class="col-sm-4">
                                            <c:if test="${pro.finish_time != null}">设计完成</c:if>
                                            <c:if test="${pro.finish_time == null && pro.is_receive != 2}">设计中</c:if>
                                            <c:if test="${pro.is_receive == 2}">已驳回</c:if>
                                        </div>
                                        <label class="col-sm-2 control-label">完成时间：</label>
                                        <div class="col-sm-4">
                                                ${pro.finish_time}
                                        </div>

                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">处理意见：</label>
                                        <div class="col-sm-4">
                                                ${pro.remark}
                                        </div>

                                    </div>
                                    <div class="form-group" id="fileDiv4">
                                        <label class="col-sm-2 control-label">附件：</label>
                                        <div class="col-sm-5">
                                            <c:forEach items="${pro.filesList}" var="files">
                                                <a target="_blank" href="${files.url}">${files.file_names}</a><br>
                                            </c:forEach>
                                        </div>
                                        <c:if test="${pro.finish_time != null}">

                                        <span class="btn btn-success fileinput-button" style="text-align: right">
                                            <span>补充文件</span>
                                            <input id="fileUpload" name="fileUpload" type="file"
                                                   onChange="ajaxUploads(this,${resultMap.tDemandSource.id},4,'fileUpload')">
                                        </span>

                                        </c:if>
                                    </div>


                                </fieldset>
                            </c:if>
                            <c:if test="${index.index >= 2}">

                                <fieldset>
                                    <c:if test="${index.index == 2}">

                                        <legend>需求评审</legend>
                                    </c:if>
                                    <c:if test="${pro.status == 5  || pro.status == 6}">
                                        <div class="form-group">

                                            <label class="col-sm-2 control-label">评审人：</label>
                                            <div class="col-sm-4">
                                                    ${pro.operation_name}
                                            </div>

                                            <label class="col-sm-2 control-label">评审结果：</label>
                                            <div class="col-sm-4">
                                                <c:if test="${pro.is_receive == 1}">已通过</c:if>
                                                <c:if test="${pro.is_receive == 2}">已驳回</c:if>
                                            </div>


                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">评审时间：</label>
                                            <div class="col-sm-4">
                                                    ${pro.operation_time}
                                            </div>

                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">评审意见：</label>
                                            <div class="col-sm-10">
                                                    ${pro.remark}
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">附件：</label>
                                            <div class="col-sm-10">
                                                <c:forEach items="${pro.filesList}" var="files">
                                                    <a target="_blank" href="${files.url}">${files.file_names}</a><br>
                                                </c:forEach>
                                            </div>
                                        </div>
                                    </c:if>
                                </fieldset>


                            </c:if>

                            <!--开发计划审批-->
                            <c:if test="${pro.status == 7}">
                                <fieldset>

                                    <legend>开发计划审批</legend>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">项目经理：</label>
                                        <div class="col-sm-4">
                                                ${resultMap.tDemandSource.principal}
                                        </div>


                                        <label class="col-sm-2 control-label">开发人员：</label>
                                        <div class="col-sm-4">
                                                ${pro.programmer}
                                        </div>


                                    </div>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">预计开始时间：</label>
                                        <div class="col-sm-4">
                                                ${pro.begin_time}
                                        </div>
                                        <label class="col-sm-2 control-label">预计完成时间：</label>
                                        <div class="col-sm-4">
                                                ${pro.end_time}
                                        </div>

                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">总监审批：</label>
                                        <div class="col-sm-4">
                                            <c:if test="${pro.is_majordomo ==null }">未审批</c:if>
                                            <c:if test="${pro.is_majordomo ==2 && pro.is_receive == 1}">通过</c:if>
                                            <c:if test="${pro.is_majordomo ==2 && pro.is_receive == 2}">驳回</c:if>
                                        </div>

                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">审批意见：</label>
                                        <div class="col-sm-10">
                                            <c:if test="${pro.is_majordomo !=null }">${pro.remark}</c:if>

                                        </div>
                                    </div>
                                </fieldset>
                            </c:if>


                            <!--开发计划审批-->
                            <c:if test="${pro.status == 8 || pro.status == 9|| pro.status == 10}">
                                <fieldset>

                                    <legend>开发进度</legend>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">开发人员：</label>
                                        <div class="col-sm-4">
                                                ${pro.operation_name}
                                        </div>


                                        <label class="col-sm-2 control-label">开发进度：</label>
                                        <div class="col-sm-4">
                                            <c:if test="${pro.status == 9}">开发中</c:if>
                                            <c:if test="${pro.status == 10}">开发完成</c:if>
                                        </div>


                                    </div>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">实际开始时间：</label>
                                        <div class="col-sm-4">
                                                ${pro.operation_time}
                                        </div>
                                        <label class="col-sm-2 control-label">实际完成时间：</label>
                                        <div class="col-sm-4">
                                                ${pro.finish_time}
                                        </div>

                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">处理意见：</label>
                                        <div class="col-sm-4">
                                                ${pro.remark}
                                        </div>

                                    </div>
                                    <div class="form-group" id="fileDiv10">
                                        <label class="col-sm-2 control-label">附件：</label>
                                        <div class="col-sm-5">
                                            <c:forEach items="${pro.filesList}" var="files">
                                                <a target="_blank" href="${files.url}">${files.file_names}</a><br>
                                            </c:forEach>
                                        </div>

                                        <c:if test="${pro.status == 10}">

                                        <span class="btn btn-success fileinput-button" style="text-align: right">
                                            <span>补充文件</span>
                                            <input id="fileUpload1" name="fileUpload" type="file"
                                                   onChange="ajaxUploads(this,${resultMap.tDemandSource.id}, 10,'fileUpload1')">
                                        </span>

                                        </c:if>
                                    </div>


                                </fieldset>
                            </c:if>
                            <!--开发驳回-->
                            <c:if test="${index.index >= 4}">
                            <c:if test="${pro.status == 13}">
                                <fieldset>

                                    <legend>开发进度</legend>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">开发人员：</label>
                                        <div class="col-sm-4">
                                                ${pro.operation_name}
                                        </div>


                                        <label class="col-sm-2 control-label">处理状态：</label>
                                        <div class="col-sm-4">
                                            已驳回
                                        </div>


                                    </div>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">处理时间：</label>
                                        <div class="col-sm-4">
                                                ${pro.operation_time}
                                        </div>

                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">处理意见：</label>
                                        <div class="col-sm-4">
                                                ${pro.remark}
                                        </div>

                                    </div>
                                </fieldset>
                            </c:if>
                        </c:if>

                            <!--测试详细-->
                            <c:if test="${pro.status == 11 || pro.status == 12}">
                                <fieldset>

                                    <legend>测试进度</legend>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">测试人员：</label>
                                        <div class="col-sm-4">
                                                ${pro.operation_name}
                                        </div>


                                        <label class="col-sm-2 control-label">测试进度：</label>
                                        <div class="col-sm-4">
                                            <c:if test="${pro.status == 11}">测试中</c:if>
                                            <c:if test="${pro.status == 12}">完成</c:if>
                                        </div>


                                    </div>
                                    <div class="form-group">

                                        <label class="col-sm-2 control-label">开始时间：</label>
                                        <div class="col-sm-4">
                                                ${pro.operation_time}
                                        </div>
                                        <label class="col-sm-2 control-label">完成时间：</label>
                                        <div class="col-sm-4">
                                                ${pro.finish_time}
                                        </div>

                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">处理意见：</label>
                                        <div class="col-sm-4">
                                                ${pro.remark}
                                        </div>

                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">附件：</label>
                                        <div class="col-sm-10">
                                            <c:forEach items="${pro.filesList}" var="files">
                                                <a target="_blank" href="${files.url}">${files.file_names}</a><br>
                                            </c:forEach>
                                        </div>
                                    </div>

                                </fieldset>
                            </c:if>

                        </c:forEach>
                        <fieldset>
                            <div class="form-group">
                                <div class="col-sm-7" style="text-align: right;margin-top: 30px">

                                    <c:if test="${resultMap.tDemandSource.isSuspend == 1}">

                                        <!--需求审核按钮-->
                                        <c:if test="${isCheck != null && resultMap.tDemandSource.status == 1}">
                                            <input value="通过" class="btn  btn-primary"
                                                   type="button"
                                                   onclick="outBox(${resultMap.tDemandSource.status},${resultMap.tDemandSource.id},1,'通过-需求审核','goCheckDemandPage.html')">
                                            <button class="btn  btn--white"
                                                    onclick="outBox(${resultMap.tDemandSource.status},${resultMap.tDemandSource.id},2,'驳回-需求审核','goCheckDemandPage.html')"
                                                    style="background-color: #f7a54a;color: white" type="button">驳回
                                            </button>

                                            <button id="updBtn" class="btn  btn--white"
                                                    demId="${resultMap.tDemandSource.id}"
                                                    style="background-color: #0e90d2;color: white" type="button">编辑
                                            </button>
                                        </c:if>
                                        <!--产品设计按钮-->
                                        <c:if test="${isCheck != null && resultMap.tDemandSource.status == 2}">
                                            <input value="开始设计"
                                                   onclick="conOutBox(${resultMap.tDemandSource.status},${resultMap.tDemandSource.id},1,'开始-产品设计')"
                                                   class="btn btn-primary"
                                                   type="button">
                                            <button class="btn  btn--white"
                                                    onclick="outBox(${resultMap.tDemandSource.status},${resultMap.tDemandSource.id},2,'驳回-产品设计','goCheckDemandPage.html')"
                                                    style="background-color: #f7a54a;color: white" type="button">驳回
                                            </button>
                                        </c:if>

                                        <c:if test="${isCheck != null && resultMap.tDemandSource.status == 3}">
                                            <input value="设计完成" demandId="${resultMap.tDemandSource.id}" isReceive="1"
                                                   status="${resultMap.tDemandSource.status}" class="btn  btn-primary"
                                                   type="button"
                                                   onclick="outBox(${resultMap.tDemandSource.status},${resultMap.tDemandSource.id},1,'完成-产品设计','goCheckDemandPage.html')"
                                                   id="designBtn">
                                        </c:if>

                                        <!--评审按钮-->
                                        <c:if test="${isCheck != null && resultMap.tDemandSource.status == 4 || isCheck != null && resultMap.tDemandSource.status == 5}">
                                            <input value="通过"
                                                   onclick="reviewDemand(${resultMap.tDemandSource.status},${resultMap.tDemandSource.id},1)"
                                                   class="btn  btn-primary" type="button">
                                            <button class="btn  btn--white"
                                                    onclick="reviewDemand(${resultMap.tDemandSource.status},${resultMap.tDemandSource.id},2)"
                                                    style="background-color: #f7a54a;color: white" type="button">驳回
                                            </button>
                                        </c:if>


                                        <!--分配开发计划按钮-->
                                        <c:if test="${isCheck != null && resultMap.tDemandSource.status == 6}">
                                            <input value="分配任务"
                                                   onclick="alloctionDemand(${resultMap.tDemandSource.status},${resultMap.tDemandSource.id},1)"
                                                   class="btn  btn-primary" type="button">

                                        </c:if>
                                        <!--开发计划审批按钮-->
                                        <c:if test="${isCheck != null && resultMap.tDemandSource.status == 7}">
                                            <input value="通过"
                                                   onclick="outBox(${resultMap.tDemandSource.status},${resultMap.tDemandSource.id},1,'通过-计划审批','goCheckDemandPage.html')"
                                                   class="btn  btn-primary" type="button">
                                            <button class="btn  btn--white"
                                                    onclick="outBox(${resultMap.tDemandSource.status},${resultMap.tDemandSource.id},2,'驳回-计划审批','goCheckDemandPage.html')"
                                                    style="background-color: #f7a54a;color: white" type="button">驳回
                                            </button>
                                        </c:if>


                                        <!--开发人员按钮-->
                                        <c:if test="${isCheck != null && resultMap.tDemandSource.status == 8}">
                                            <input value="开始处理" demandId="${resultMap.tDemandSource.id}" isReceive="1"
                                                   status="${resultMap.tDemandSource.status}" class="btn  btn-primary"
                                                   onclick="conOutBox(${resultMap.tDemandSource.status},${resultMap.tDemandSource.id},1,'需求-开始处理')"
                                                   type="button">
                                        </c:if>

                                        <c:if test="${isCheck != null && resultMap.tDemandSource.status == 9}">
                                            <input value="处理完成" demandId="${resultMap.tDemandSource.id}" isReceive="1"
                                                   status="${resultMap.tDemandSource.status}" class="btn  btn-primary"
                                                   onclick="outBox(${resultMap.tDemandSource.status},${resultMap.tDemandSource.id},1,'需求-处理完成','goCheckDemandPage.html')"
                                                   type="button">
                                        </c:if>
                                    </c:if>


                                    <button id="closeBut" onclick="closeWin()" class="btn  btn--white" type="button">
                                        关闭
                                    </button>
                                </div>
                            </div>
                        </fieldset>
                    </div>


                </div>
                <div id="tab-2" class="tab-pane">
                    <div class="panel-body">
                        <fieldset>

                            <table id="cusTable"
                                   class="ui-jqgrid-btable ui-common-table table table-bordered">
                                <tbody>
                                <tr role="row" style="background: #F5F5F5;">
                                    <td>操作人
                                    </td>
                                    <td>暂停时间
                                    </td>
                                    <td>暂停原因
                                    </td>
                                    <td>开始时间
                                    </td>
                                    <td>开始原因
                                    </td>
                                </tr>


                                <c:forEach items="${resultMap.supList}" var="sup">
                                    <tr class="jqgrow ui-row-ltr">

                                        <td>
                                                ${sup.operation_name}
                                        </td>
                                        <td>
                                                ${sup.operation_time}
                                        </td>
                                        <td>
                                                ${sup.suspend_cause}
                                        </td>
                                        <td>
                                                ${sup.start_time}
                                        </td>
                                        <td>
                                                ${sup.begin_cause}
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>

                        </fieldset>
                        <fieldset>
                            <div class="col-sm-7" style="text-align: right;margin-top: 30px">

                                <button onclick="closeWin()" class="btn  btn--white" type="button">关闭
                                </button>
                            </div>
                        </fieldset>
                    </div>

                </div>
                <div id="tab-3" class="tab-pane">
                    <div class="panel-body">
                        <fieldset>

                            <table
                                    class="ui-jqgrid-btable ui-common-table table table-bordered">
                                <tbody>
                                <tr role="row" style="background: #F5F5F5;">
                                    <td>转移人
                                    </td>
                                    <td>转移时间
                                    </td>
                                    <td>转移原因
                                    </td>
                                    <td>接收人
                                    </td>
                                    <td>转移进度
                                    </td>
                                </tr>


                                <c:forEach items="${resultMap.traList}" var="tra">
                                    <tr class="jqgrow ui-row-ltr">

                                        <td>
                                                ${tra.transfer_name}
                                        </td>
                                        <td>
                                                ${tra.transfer_time}
                                        </td>
                                        <td>
                                                ${tra.remark}
                                        </td>
                                        <td>
                                                ${tra.receiver_name}
                                        </td>
                                        <td>
                                                ${tra.transfer_status}
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>

                        </fieldset>
                        <fieldset>
                            <div class="col-sm-7" style="text-align: right;margin-top: 30px">

                                <button onclick="closeWin()" class="btn  btn--white" type="button">关闭
                                </button>
                            </div>
                        </fieldset>
                    </div>

                </div>
                <div id="tab-4" class="tab-pane">
                    <div class="panel-body">
                        <fieldset>

                            <table
                                    class="ui-jqgrid-btable ui-common-table table table-bordered">
                                <tbody>
                                <tr role="row" style="background: #F5F5F5;">
                                    <td>驳回人
                                    </td>
                                    <td>驳回时间
                                    </td>
                                    <td>驳回原因
                                    </td>
                                    <td>结果
                                    </td>
                                    <td>处理意见
                                    </td>
                                </tr>


                                <c:forEach items="${resultMap.rejectList}" var="reject">
                                    <tr class="jqgrow ui-row-ltr">

                                        <td>
                                                ${reject.create_name}
                                        </td>
                                        <td>
                                                ${reject.create_time}
                                        </td>
                                        <td>
                                                ${reject.cause}
                                        </td>
                                        <td>
                                            <c:if test="${reject.status == 1 && null  != reject.result}">未同意</c:if>
                                            <c:if test="${reject.status == 1 && null  == reject.result}">未处理</c:if>
                                            <c:if test="${reject.status == 2}">同意</c:if>
                                        </td>
                                        <td>
                                                ${reject.result}
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>

                        </fieldset>
                        <fieldset>
                            <div class="col-sm-7" style="text-align: right;margin-top: 30px">

                                <button onclick="closeWin()" class="btn  btn--white" type="button">关闭
                                </button>
                            </div>
                        </fieldset>
                    </div>

                </div>
                <div id="tab-5" class="tab-pane">
                    <div class="panel-body">
                        <fieldset>

                            <table
                                    class="ui-jqgrid-btable ui-common-table table table-bordered">
                                <tbody>
                                <tr role="row" style="background: #F5F5F5;">
                                    <td>客户
                                    </td>
                                    <td>电话
                                    </td>
                                    <td>评价
                                    </td>
                                    <td>录入人
                                    </td>
                                    <td>录入时间
                                    </td>
                                </tr>


                                <c:forEach items="${resultMap.feedbackList}" var="feedback">
                                    <tr class="jqgrow ui-row-ltr">

                                        <td>
                                                ${feedback.customer_name}
                                        </td>
                                        <td>
                                                ${feedback.phone}
                                        </td>
                                        <td>
                                                ${feedback.remark}
                                        </td>
                                        <td>
                                                ${feedback.create_name}
                                        </td>
                                        <td>
                                                ${reject.create_time}
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>

                        </fieldset>
                        <fieldset>
                            <div class="col-sm-7" style="text-align: right;margin-top: 30px">

                                <button onclick="closeWin()" class="btn  btn--white" type="button">关闭
                                </button>
                            </div>
                        </fieldset>
                    </div>

                </div>
                <div id="tab-6" class="tab-pane">
                    <div class="panel-body">
                        <fieldset>

                            <table id="bugTab"
                                   class="ui-jqgrid-btable ui-common-table table table-bordered">
                                <tbody>
                                <tr role="row" style="background: #F5F5F5;">
                                    <td>BUG编号
                                    </td>
                                    <td>描述
                                    </td>
                                    <td>状态
                                    </td>
                                    <td>录入人
                                    </td>
                                    <td>录入时间
                                    </td>
                                </tr>


                                <c:forEach items="${resultMap.bugList}" var="tbug">
                                    <tr id="${tbug.id}"
                                        statusText="${tbug.status_text}" demandType="1" class="jqgrow ui-row-ltr">

                                        <td>
                                                ${tbug.id}
                                        </td>
                                        <td>
                                                ${fn:length(tbug.detail) > 20 ? fn:substring(tbug.detail,0,20) : tbug.detail}
                                        </td>
                                        <td>
                                                ${tbug.status_text}
                                        </td>
                                        <td>
                                                ${tbug.create_name}
                                        </td>
                                        <td>
                                                ${tbug.create_time}
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>

                        </fieldset>
                        <fieldset>
                            <div class="col-sm-7" style="text-align: right;margin-top: 30px">

                                <button onclick="closeWin()" class="btn  btn--white" type="button">关闭
                                </button>
                            </div>
                        </fieldset>
                    </div>

                </div>
            </div>
        </div>

    </form>
</div>


<script>
    function closeWin() {
        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
        parent.layer.close(index); //再执行关闭
    }

    $(document).ready(function () {
        $("#demandForm").validate({

            rules: {

                title: {
                    required: true,
                },
                department: {
                    min: 0,
                },
                principal: {
                    min: 0,
                }
            },
            messages: {
                title: {
                    required: '请填写标题'
                },

                feedback_name: {
                    required: '请填写反馈人姓名'
                },
                department: {
                    min: '请选择部门'
                },
                principal: {
                    min: '请选择部门负责人'
                }
            }
        });

        $('.loopitem').eq(0).find('.dir_line').hide()


        //双击tr弹出页面
        $("#bugTab tr td").dblclick(function () {


            var content = 'bugDetail.html?bugId=';
            var demandType = "BUG"

            //alert($(this).html());
            //alert($(this).attr('custId'));
            //alert($(this).parent('tr').attr('custId'));
            var title = demandType + "-" + $(this).parent('tr').attr('statusText');
            index = layer.open({
                type: 2,
                title: title,
                skin: 'ilayui-layer-rm', //加上边框
                area: ['100%', '100%'], //宽高
                content: content + $(this).parent('tr').attr('id'),
//                end: function () {
//                    location.reload();
//                }
            });
        });

    });

    var index = 0;

    //弹出页面
    function conOutBox(status, id, isReceive, title) {

        var obj = $(this);
        layer.msg(title, {
            time: 0 //不自动关闭
            , btn: ['确定', '取消']
            , yes: function (index) {


                var args = {
                    "demandId": id,
                    "status": status,
                    "isReceive": isReceive
                }

                var url = "checkDemandPage.html";

                //加载进度条
                layer.load(2, {
                    shade: [0.2, '#999999'] //0.1透明度的白色背景
                });
                $.post(url, args, function (data) {
                    data = jQuery.parseJSON(data);
                    //保存成功
                    if (data.code == 1) {
                        window.location.reload();
                        layer.closeAll('loading');
                    } else {
                        //失败
                        layer.alert(data.msg);
                        layer.closeAll('loading');
                    }
                });
                layer.close(index);

            }
        });
    }


    //弹出页面
    function outBox(status, id, isReceive, title, action) {


        //alert($(this).html());
        //alert($(this).attr('status'));
        //alert($(this).attr('bug_id'));
        //alert($(this).parent('tr').attr('custId'));
        index = layer.open({
            type: 2,
            title: title,
            skin: 'ilayui-layer-rm', //加上边框
            area: ['30%', '70%'], //宽高
            content: action + '?id=' + id + "&status=" + status
            + "&isReceive=" + isReceive
//                end: function () {
//                    location.reload();
//                }

        });
    }

    //评审按钮
    function reviewDemand(status, id, isReceive) {

        var title = "通过-需求评审";
        if (2 == isReceive) {
            title = "驳回-需求评审";
        }

        //alert($(this).html());
        //alert($(this).attr('status'));
        //alert($(this).attr('bug_id'));
        //alert($(this).parent('tr').attr('custId'));
        index = layer.open({
            type: 2,
            title: title,
            skin: 'ilayui-layer-rm', //加上边框
            area: ['40%', '80%'], //宽高
            content: 'goReviewDemandPage.html?id=' + id + "&status=" + status
            + "&isReceive=" + isReceive
//                end: function () {
//                    location.reload();
//                }

        });

    }

    //编辑按钮
    $("#updBtn").click(function () {
        window.location = 'goUpdDemand.html?id=' + $(this).attr('demId');
    });

    //分配需求按钮
    function alloctionDemand(status, id, isReceive) {

        var title = "分配任务";

        //alert($(this).html());
        //alert($(this).attr('status'));
        //alert($(this).attr('bug_id'));
        //alert($(this).parent('tr').attr('custId'));
        index = layer.open({
            type: 2,
            title: title,
            skin: 'ilayui-layer-rm', //加上边框
            area: ['40%', '80%'], //宽高
            content: 'goExpPlan.html?id=' + id + "&status=" + status
            + "&isReceive=" + isReceive
//                end: function () {
//                    location.reload();
//                }

        });

    }
</script>
</body>
</html>
